﻿using System;

namespace DragDraw.Service
{
    /// <summary>
    /// 数据层接口异常，表示找不到相应对象
    /// </summary>
    public class DataNotFoundException : Exception
    {
        /// <summary>
        /// DataNotFoundException构造函数
        /// </summary>
        /// <param name="message">异常描述</param>
        /// <param name="innerException">内部异常</param>
        public DataNotFoundException(string message, Exception innerException)
            : base(message, innerException)
        { }
    }

    /// <summary>
    /// 数据层接口异常，表示重复Insert错误
    /// </summary>
    public class DataInsertException : Exception
    {
        /// <summary>
        /// DataNotFoundException构造函数
        /// </summary>
        /// <param name="message">异常描述</param>
        /// <param name="innerException">内部异常</param>
        public DataInsertException(string message, Exception innerException)
            : base(message, innerException)
        { }
    }

    /// <summary>
    /// 数据层接口异常，表示数据库出现一般性错误（例如无法连接）
    /// </summary>
    public class DataErrorException : Exception
    {
        /// <summary>
        /// DataErrorException构造函数
        /// </summary>
        /// <param name="message">异常描述</param>
        /// <param name="innerException">内部异常</param>
        public DataErrorException(string message, Exception innerException)
            : base(message, innerException)
        { }
    }
}
